package com.du.springmvc.bean;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.time.LocalDate;

/**
 * @author : DuJiabao
 * @Project : spring-mvc
 * @Time : 2021/4/6 19:04
 * @Desc :
 */
public class People {
  @Email
  private String email;
  @NotEmpty
  private String lastName;
  @Past
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate birthday;
  @Future
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private LocalDate plan;

  public People(@Email String email, @NotEmpty String lastName, @Past LocalDate birthday, @Future LocalDate plan) {
    this.email = email;
    this.lastName = lastName;
    this.birthday = birthday;
    this.plan = plan;
  }

  public People() {
  }


  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public LocalDate getBirthday() {
    return birthday;
  }

  public void setBirthday(LocalDate birthday) {
    this.birthday = birthday;
  }

  public LocalDate getPlan() {
    return plan;
  }

  public void setPlan(LocalDate plan) {
    this.plan = plan;
  }

  @Override
  public String toString() {
    return "People{" +
            "email='" + email + '\'' +
            ", lastName='" + lastName + '\'' +
            ", birthday=" + birthday +
            ", plan=" + plan +
            '}';
  }
}
